<?
class fileResource
{
	protected $fileContent;
	function fileResource($file)
	{
		if(is_file($file))
		{
			$this->fileContent= file_get_contents($file);
			
		}else
		{
			$this->fileContent=sprintf(ERROR_MESSAGE,"El archivo que intenta abrir es incorrecto");
		}
	}
	function getSubpart($subpart){
	return HTML::getSubpart($this->fileContent,$subpart);
	}
	
	function detectSubpart($subpart){
	return HTML::detectSubpart($this->fileContent,$subpart);
	}
	function detectMarker($marker){
	return HTML::detectSubpart($this->fileContent,$marker);
	}
	function substituteSubpart($subpart,$result){
	
	$this->fileContent =  HTML::substituteSubpart($this->fileContent,$subpart,$result);
	//var_dump($this->fileContent);
	}
	function substituteMarkerArray($result){
	 $this->fileContent =HTML::substituteMarkerArray($this->fileContent,$result);
	}
	function substituteMarker($marker,$result){
	 $this->fileContent =HTML::substituteMarker("###$marker###",$result,$this->fileContent);
	}
	function substituteAllMarker($result){
	 $this->fileContent =HTML::substituteAllMarker($result,$this->fileContent);
	}
		
	function render()
	{
		return $this->fileContent;
	}
}


?>